/*
 * @Descripttion:调用后端收藏接口的函数
 */

import axios from 'axios'

// 创建收藏项
const makeCollection = collection =>
	axios.post('/api/test/user/makeCollection', {
		accountId: collection.accountId,
		commodityId: collection.commodityId,
		cTime: collection.cTime,
	}).then(res => res.data)

// 读取收藏列表
const listCollections = (user_id) =>
	axios.get('/api/test/shop/user/collections', {
		params: {
			accountId: user_id,
		}
	})
	.then(res => res.data)

export {
	makeCollection,
	listCollections,
}
